<!--
 * Description: SupplyCloud新增页面
 * Company: 联宝（合肥）电子科技有限公司
 * Author: Dongxu.Ni
 * Date: 2020/04/14 02:52
-->

<template>
  <div>
    <!--数据表单-->
    <el-form label-width="150px" :model="formData" size="mini">
      <el-row>
        <!--pn-->
        <el-col :span="12">
          <el-form-item label="PN">
            <el-input v-model="formData.pn" clearable />
          </el-form-item>
        </el-col>

        <!--vendor-->
        <el-col :span="12">
          <el-form-item label="Vendor">
            <el-input v-model="formData.vendor" clearable />
          </el-form-item>
        </el-col>

        <!--sourceCode-->
        <el-col :span="12">
          <el-form-item label="SourceCode">
            <el-input v-model="formData.sourceCode" clearable />
          </el-form-item>
        </el-col>

        <!--quarter-->
        <el-col :span="12">
          <el-form-item label="Quarter">
            <el-input v-model="formData.quarter" clearable />
          </el-form-item>
        </el-col>

        <!--baseUnitPrice-->
        <el-col :span="12">
          <el-form-item label="BaseUnitPrice">
            <el-input-number
              v-model="formData.baseUnitPrice"
              clearable
              controls-position="right"
              :min="1"
            />
          </el-form-item>
        </el-col>

        <!--outTapeSavingFin-->
        <el-col :span="12">
          <el-form-item label="OutTapeSavingFin">
            <el-input-number
              v-model="formData.outTapeSavingFin"
              clearable
              controls-position="right"
              :min="1"
            />
          </el-form-item>
        </el-col>

        <!--outTapeSavingScm-->
        <el-col :span="12">
          <el-form-item label="OutTapeSavingScm">
            <el-input-number
              v-model="formData.outTapeSavingScm"
              clearable
              controls-position="right"
              :min="1"
            />
          </el-form-item>
        </el-col>

        <!--fiscalYear-->
        <el-col :span="12">
          <el-form-item label="FiscalYear">
            <el-input-number
              v-model="formData.fiscalYear"
              clearable
              controls-position="right"
              :min="1"
            />
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <span style="display: block;text-align: center;margin-top: 5px">
      <!--取消按钮-->
      <el-button size="medium" @click="cancel">{{ $t('button.cancel') }}</el-button>
      <!--保存按钮-->
      <el-button size="medium" type="primary" @click="save">{{ $t('button.save') }}</el-button>
    </span>
  </div>
</template>

<script>
import { quarterPriceGRAdd } from '@/api/spendingSaving/spendingSaving'

export default {
  name: 'QuarterPriceAdd',
  props: {},
  data() {
    return {
      formData: {}
    }
  },

  methods: {
    save() {
      quarterPriceGRAdd(this.formData).then(() => {
        this.$emit('save')
      })
    },
    cancel() {
      this.$emit('cancel')
    }
  }
}
</script>
